package com.app.micaihu.bean.news;

import android.view.View;
import android.widget.TextView;

import com.app.micaihu.R;
import com.app.micaihu.custom.components.downandupload.LoadingView;
import com.app.micaihu.videoplayer.JCVideoPlayer;
import com.app.micaihu.videoplayer.JCVideoPlayerGame;
import com.app.utils.util.image.LoadImageUtils;


/**
 * 游戏视频大图(适配推荐列表的视频)
 * Created by linkai on 2016/7/18.
 */
public class ViewGameVideoOne extends ViewNewsParent {

    private JCVideoPlayerGame jcVideoPlayerStandard;
    private LoadingView downloadView;//下载按钮
    private TextView gameName;//游戏名称

    public ViewGameVideoOne(View convertView) {
        initView(convertView);
    }

    public void initView(View convertView) {
        super.initView(convertView);
        jcVideoPlayerStandard = (JCVideoPlayerGame) convertView.findViewById(R.id.item_videoplayer);
        downloadView = (LoadingView) convertView.findViewById(R.id.ad_download);
        gameName = (TextView) convertView.findViewById(R.id.item_public_author);
        LoadImageUtils.getInstance().loadImage(mark, R.drawable.infor_list_home_game,false);
        convertView.setTag(this);
    }

    /**
     * 加载数据
     * @param newsEntity
     */
    public void loadData(NewsEntity newsEntity){
        super.loadDataNoMark(newsEntity);
        jcVideoPlayerStandard.setUp(newsEntity.getVideoCurl(), JCVideoPlayer.SCREEN_LAYOUT_LIST,
                newsEntity.getArticleTitle(),newsEntity.getArticleThumb()[0], newsEntity.getPlayTime());
        jcVideoPlayerStandard.setShareBean(newsEntity, newsEntity.getUrlStatus());
        gameName.setText(newsEntity.getAppName()+" "+newsEntity.getAppSize());
        downloadView.setTag(newsEntity);
    }

}
